package controller {
	import controller.command.StartupCommand;
	import controller.command.StateChangeCommand;
	import controller.signal.DebugSignal;
	import controller.signal.PhotosLoadedSignal;
	import controller.signal.StateChangeSignal;
	
	import flash.display.DisplayObjectContainer;
	
	import model.ConfigModel;
	import model.PhotoModel;
	import model.UserModel;
	
	import mx.controls.Alert;
	
	import org.robotlegs.mvcs.SignalContext;
	
	import subumbo.leg.model.signal.StateChangedSignal;
	
	import view.DebugView;
	import view.DebugViewMediator;
	import view.PrivateView;
	import view.PrivateViewMediator;
	import view.PublicView;
	import view.PublicViewMediator;
	
	public class SmirnoffContext extends SignalContext {
		
		public function SmirnoffContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true) {
			super(contextView, autoStartup);
		}
		
		public override function startup():void {
			super.startup();
			
			injector.mapSingleton(ConfigModel);
			injector.mapSingleton(PhotoModel);
			injector.mapSingleton(PhotosLoadedSignal);
			injector.mapSingleton(UserModel);
			injector.mapSingleton(DebugSignal);
			
			mediatorMap.mapView(PrivateView, PrivateViewMediator);
			mediatorMap.mapView(PublicView, PublicViewMediator);
			mediatorMap.mapView(DebugView, DebugViewMediator);
			
			signalCommandMap.mapSignalClass(StateChangeSignal, StateChangeCommand);
			
			commandMap.execute(StartupCommand);
		}
	}
}